package com.monitor.util.enums;

public class PositonUtil {
	
	public static String[] getByTypeId(Integer carType) {
		if(carType==1) {
			return new String[]{"01","02","11","12","20"};
		}else if(carType==2) {
			return new String[]{"01","02","11","12","13","14","20"};
		}else if(carType==3) {
			return new String[]{"01","02","11","12","21","22","23","24","30"};
		}else if(carType==4) {
			return new String[]{"01","02","11","12","13","14","21","22","30"};
		}else if(carType==5) {
			return new String[]{"01","02","11","12","13","14","21","22","23","24","30"};
		}else if(carType==6) {
			return new String[]{"01","02","11","12","21","22","23","24","31","32","33","34","40"};
		}else if(carType==7) {
			return new String[]{"01","02","11","12","21","22","30"};
		}else if(carType==8) {
			return new String[]{"01","02","03","04","11","12","13","14","21","22","23","24","30"};
		}else if(carType==9) {
			return new String[]{"01","02","03","04","11","12","13","14","20"};
		}
		return null;
	}
	
	public static String getStringByTypeId(String po,int carType) {
		String wei="";
		if(carType==1) {
			switch(po) {
			case "01":
				wei="左1轮";
				break;
			case "02":
				wei="右1轮";
				break;
			case "11":
				wei="左2轮";
				break;
			case "12":
				wei="右2轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==2) {
			switch(po) {
			case "01":
				wei="左1轮";
				break;
			case "02":
				wei="右1轮";
				break;
			case "11":
				wei="左2外轮";
				break;
			case "12":
				wei="左2内轮";
				break;
			case "13":
				wei="右2内轮";
				break;
			case "14":
				wei="右2外轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==3) {
			switch(po) {
			case "01":
				wei="左1轮";
				break;
			case "02":
				wei="右1轮";
				break;
			case "11":
				wei="左2轮";
				break;
			case "12":
				wei="右2轮";
				break;
			case "21":
				wei="左3外轮";
				break;
			case "22":
				wei="左3内轮";
				break;
			case "23":
				wei="右3内轮";
				break;
			case "24":
				wei="右3外轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==4) {
			switch(po) {
			case "01":
				wei="左1轮";
				break;
			case "02":
				wei="右1轮";
				break;
			case "11":
				wei="左2外轮";
				break;
			case "12":
				wei="左2内轮";
				break;
			case "13":
				wei="右2内轮";
				break;
			case "14":
				wei="右2外轮";
				break;
			case "21":
				wei="左3轮";
				break;
			case "22":
				wei="右3轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==5) {
			switch(po) {
			case "01":
				wei="左1轮";
				break;
			case "02":
				wei="右1轮";
				break;
			case "11":
				wei="左2外轮";
				break;
			case "12":
				wei="左2内轮";
				break;
			case "13":
				wei="右2内轮";
				break;
			case "14":
				wei="右2外轮";
				break;
			case "21":
				wei="左3外轮";
				break;
			case "22":
				wei="左3内轮";
				break;
			case "23":
				wei="右3内轮";
				break;
			case "24":
				wei="右3外轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==6) {
			switch(po) {
			case "01":
				wei="左1轮";
				break;
			case "02":
				wei="右1轮";
				break;
			case "11":
				wei="左2轮";
				break;
			case "12":
				wei="右2轮";
				break;
			case "21":
				wei="左3外轮";
				break;
			case "22":
				wei="左3内轮";
				break;
			case "23":
				wei="右3内轮";
				break;
			case "24":
				wei="右3外轮";
				break;
			case "31":
				wei="左4外轮";
				break;
			case "32":
				wei="左4内轮";
				break;
			case "33":
				wei="右4内轮";
				break;
			case "34":
				wei="右4外轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==7) {
			switch(po) {
			case "01":
				wei="左1轮";
				break;
			case "02":
				wei="右1轮";
				break;
			case "11":
				wei="左2轮";
				break;
			case "12":
				wei="右2轮";
				break;
			case "21":
				wei="左3轮";
				break;
			case "22":
				wei="右3轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==8) {
			switch(po) {
			case "01":
				wei="左1外轮";
				break;
			case "02":
				wei="左1内轮";
				break;
			case "03":
				wei="右1内轮";
				break;
			case "04":
				wei="右1外轮";
				break;
			case "11":
				wei="左2外轮";
				break;
			case "12":
				wei="左2内轮";
				break;
			case "13":
				wei="右2内轮";
				break;
			case "14":
				wei="右2外轮";
				break;
			case "21":
				wei="左3外轮";
				break;
			case "22":
				wei="左3内轮";
				break;
			case "23":
				wei="右3内轮";
				break;
			case "24":
				wei="右3外轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}else if(carType==9) {
			switch(po) {
			case "01":
				wei="左1外轮";
				break;
			case "02":
				wei="左1内轮";
				break;
			case "03":
				wei="右1内轮";
				break;
			case "04":
				wei="右1外轮";
				break;
			case "11":
				wei="左2外轮";
				break;
			case "12":
				wei="左2内轮";
				break;
			case "13":
				wei="右2内轮";
				break;
			case "14":
				wei="右2外轮";
				break;
			default:
				wei="备胎";
				break;
			}
		}
		return wei;
	}
	
	public static String[] getChineseByTypeId(Integer typeId) {
		String[] str=null;
		switch (typeId) {
		case 1:
			str=new String[]{"左1轮","右1轮","左2轮","右2轮","备胎"};
			break;
		case 2:
			str=new String[]{"左1轮","右1轮","左2外轮","左2内轮","右2内轮","右2外轮","备胎"};
			break;
		case 3:
			str=new String[]{"左1轮","右1轮","左2轮","右2轮","左3外轮","左3内轮","右3内轮","右3外轮","备胎"};
			break;
		case 4:
			str=new String[]{"左1轮","右1轮","左2外轮","左2内轮","右2内轮","右2外轮","左3轮","右3轮","备胎"};
			break;
		case 5:
			str=new String[]{"左1轮","右1轮","左2外轮","左2内轮","右2内轮","右2外轮","左3外轮","左3内轮","右3内轮","右3外轮","备胎"};
			break;
		case 6:
			str=new String[]{"左1轮","右1轮","左2轮","右2轮","左3外轮","左3内轮","右3内轮","右3外轮","左4外轮","左4内轮","右4内轮","右4外轮","备胎"};
			break;
		case 7:
			str=new String[]{"左1轮","右1轮","左2轮","右2轮","左3轮","右3轮","备胎"};
			break;
		case 8:
			str=new String[]{"左1外轮","左1内轮","右1内轮","右1外轮","左2外轮","左2内轮","右2内轮","右2外轮","左3外轮","左3内轮","右3内轮","右3外轮","备胎"};
			break;
		case 9:
			str=new String[]{"左1外轮","左1内轮","右1内轮","右1外轮","左2外轮","左2内轮","右2内轮","右2外轮","备胎"};
			break;
		default:
			break;
		}
		return str;
	}
	
	public static Integer carWheelToCarType(String wheel) {
		if(wheel.equals("2-2")) {
			return 1;
		}else if(wheel.equals("2-4")) {
			return 2;
		}else if(wheel.equals("2-2-4")) {
			return 3;
		}else if(wheel.equals("2-4-2")) {
			return 4;
		}else if(wheel.equals("2-4-4")) {
			return 5;
		}else if(wheel.equals("2-2-4-4")) {
			return 6;
		}else if(wheel.equals("2-2-2")) {
			return 7;
		}else if(wheel.equals("4-4-4")) {
			return 8;
		}else if(wheel.equals("4-4")) {
			return 9;
		}
		return 0;
	}
}
